const Table = `
type Table {
    name: String!
}

type Field {
    name: String!
    type: String!
    length: Int
    not_null: Boolean
    key: Boolean
    values: String
    default: String
}
`;

export default () => [Table];

import dbms from '../../dbms';
const data = dbms.table;

export const queryDefs = `
fields(connection: String!, database: String!, table: String!): [Field]
count(connection: String!, database: String!, table: String!): Int
`;

export const queries = {
    fields(_, {connection: conn, database: db, table}) {
        return data.fields({conn, db, table});
    },
    count(_, {connection: conn, database: db, table}) {
        return data.count({conn, db, table});
    }
};

export const mutations = {};
